<?php
// +----------------------------------------------------------------------
// | OneKeyAdmin [ Believe that you can do better ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020-2023 http://onekeyadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: MUKE <513038996@qq.com>
// +----------------------------------------------------------------------
namespace plugins\blog\api\validate;

use think\Validate;

class UserComment extends Validate
{
    protected $rule = [
        'id'            => 'require|number',
        'pid'           => 'require|number', 
        'reply_user_id' => 'require|number',
        'content'       => 'require|max:65535',
        'page'          => 'require|number',
    ];
    protected $message  =   [
        'id.require'            => '编号不能为空',
        'id.number'             => '编号类型错误',
        'pid.require'           => '父级不能为空',
        'pid.number'            => '父级类型错误',
        'reply_user_id.require' => '回复对象不能为空',
        'reply_user_id.number'  => '回复对象类型错误',
        'content.require'       => '内容不能为空',
        'content.max'           => '内容不能超过65535个字符',
        'page.require'          => '分页不能为空',
        'page.number'           => '分页类型错误',
    ];
    protected $scene = [
        'index'      => ['page'],
        'save'       => ['id','pid','reply_user_id','content'],
        'delete'     => ['id'], 
    ];
}